package com.example.puback.consumer;

import com.example.puback.config.ConfirmConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @version 1.0.0
 * @className: ConfirmConsumer
 * @description: 消息的消费者，监听 confirm-queue 队列
 * @author: LiJunYi
 * @create: 2022/8/4 15:01
 */
@Component
@Slf4j
public class ConfirmConsumer
{
    @RabbitListener(queues = ConfirmConfig.CONFIRM_QUEUE_NAME)
    public void receiveMsg(Message message)
    {
        log.info("接收到的消息为: " + new String(message.getBody()));
    }
}
